package ru.isys.xml.template;

public class DivInput
{
    
    //<div class="field">
    //<xf:input ref="instance('${instance}')//Документ@ВерсФорм">
    //    <xf:label>ВерсФорм: </xf:label>             
    //    <xf:hint>Версия формата</xf:hint>
    //</xf:input>
    //</div>  
public static final String DIV_OPEN_TAG="\n<div class=\"field\">";
public static final String INPUT_TAG_FIRST_PART ="\n\t<xf:input ref=\"instance('${instance}')//";
public static final String INPUT_TAG_SECOND_PART ="\">";
public static final String LABEL_OPEN_TAG="\n\t\t<xf:label>";
public static final String HINT_OPEN_TAG="\n\t\t<xf:hint>";
public static final String ALERT_OPEN_TAG="\n\t\t<xf:alert>";
public static final String LABEL_CLOSE_TAG="</xf:label>";
public static final String HINT_CLOSE_TAG="</xf:hint>";
public static final String ALERT_CLOSE_TAG="</xf:alert>";
public static final String INPUT_CLOSE_TAG="\n\t</xf:input>";
public static final String DIV_CLOSE_TAG="\n</div>";
private String tag="";
private String fullName;
private String label;
private String alert;
private String hint;

public DivInput (String fullName){
    this.fullName=fullName;
}

public DivInput (String fullName, String label, String alert, String hint){
    this.fullName=fullName;
    this.alert=alert;
    this.hint=hint;
    this.label=label;
}


public String getTag(){
    tag+=DIV_OPEN_TAG+INPUT_TAG_FIRST_PART+fullName+INPUT_TAG_SECOND_PART;
    if (alert!=null){
        tag+=ALERT_OPEN_TAG+label+ALERT_CLOSE_TAG;
    }
    if (label!=null){
        tag+=LABEL_OPEN_TAG+label+LABEL_CLOSE_TAG;
    }
    if (hint!=null){
        tag+=HINT_OPEN_TAG+hint+HINT_CLOSE_TAG;
    }
    tag+=INPUT_CLOSE_TAG+DIV_CLOSE_TAG;
    return tag;
}



public String getFullName()
{
    return fullName;
}



public void setFullName(String fullName)
{
    this.fullName = fullName;
}



public String getLabel()
{
    return label;
}



public void setLabel(String label)
{
    this.label = label;
}



public String getAlert()
{
    return alert;
}



public void setAlert(String alert)
{
    this.alert = alert;
}



public String getHint()
{
    return hint;
}



public void setHint(String hint)
{
    this.hint = hint;
}

}
